#pragma once
#include <memory>
#include <thread>
#include <atomic>
#include <mutex>
#include "Request.h"
#include "../Util/SyncQueue.h"
class RequestManager
{
private:
    SyncQueue<std::shared_ptr<Request>> requestQueue_;
    std::thread thread_;
    std::once_flag flagonce_;
    std::once_flag flagonce_stop_;
    std::atomic_bool running_;
private:
    std::shared_ptr<Request> top_request_;
public:
    RequestManager(/* args */);
    ~RequestManager();

private:
    void StartThread();
    void StopThread();
    void ThreadRunning();
public:
    void AddRequest(std::shared_ptr<Request> spRequest);
    void SetRequest_GetResponse(uint16_t serial);
};
